package com.woniuxy.controller;

import com.woniuxy.entity.User;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rest")
public class RestfulController {
    //请求该请求的方法必须是get    //查
    @GetMapping("/find/{abc}")
    public String findGoodsById(@PathVariable("abc") int id) {
        System.out.println(id);

        return "success";

    }

    //该请求必须是post   增
    @PostMapping("/regist/{account}/{pwd}")
    public String regist(User user) {

        System.out.println(user);
        return "success";
    }

    //删
    @DeleteMapping("/del/{jid}/{nid}")
    public String del(@PathVariable("jid") int jid, @PathVariable("nid") int nid) {
        System.out.println(jid + "," + nid);
        return "success";
    }

    //改
    @PutMapping
    public String update(@PathVariable("id") int id) {
        System.out.println(id);
        return "success";
    }

    /*
     *
     *
     *
     *
     */


}
